﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using l1cs.server.model.Instance;

namespace l1cs.server.serverpackets
{
    public class S_TradeAddItem : ServerBasePacket
    {
        private static Logger _log = Logger.getLogger( typeof( S_TradeAddItem ).FullName );

        public S_TradeAddItem( L1ItemInstance item, int count, int type )
        {
            writeC( Opcodes.S_OPCODE_TRADEADDITEM );
            writeC( type ); // 0:トレードウィンドウ上段 1:トレードウィンドウ下段
            writeH( item.getItem().getGfxId() );
            writeS( item.getNumberedViewName( count ) );
            // 0:祝福  1:通常 2:呪い 3:未鑑定
            // 128:祝福&封印 129:&封印 130:呪い&封印 131:未鑑定&封印
            writeC( item.getBless() );
            writeC( 0x00 );
        }

        override
        public byte[] getContent()
        {
            return getBytes();
        }

        override
        public String getType()
        {
            return "[S] S_TradeAddItem";
        }
    }
}
